package com.hbu.housingbrokerug.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.hub.R;

/**
 * 
 * @author Lubwama Samuel
 *
 */

public class CategoryType extends Activity {
	Button residentialRental,residentialSale, businessRental,businessSale,businessLet;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.category_type);
		residentialRental=(Button) findViewById(R.id.residetial_rent);
		residentialSale=(Button) findViewById(R.id.residential_sale);
		businessRental=(Button) findViewById(R.id.business_rental);
		businessSale=(Button) findViewById(R.id.business_sale);
		businessLet=(Button) findViewById(R.id.business_let);
		
		residentialRental.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				StartCategoryActivity("residential","rent");
			}
			  
		  });
		
		residentialSale.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				StartCategoryActivity("residential","sale");
			}
			  
		  });
		
		
		businessRental.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				StartCategoryActivity("business","rent");
			}
			  
		  });
		
		businessSale.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				StartCategoryActivity("business","sale");
			}
			  
		  });
		
		businessLet.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				StartCategoryActivity("business","let");
			}
			  
		  });
		
	}

	protected void StartCategoryActivity(String category_type, String reason) {
		Intent intent = new Intent(getApplicationContext(), Category.class);
		intent.putExtra("CATEGORY_TYPE", category_type);
		intent.putExtra("REASON", reason);
		startActivity(intent);	
	}
}